package de.fhhannover.inform.itteam.snmpnetviz.gui.renderer;

import java.awt.Graphics2D;

import prefuse.Constants;
import prefuse.render.EdgeRenderer;
import prefuse.util.ColorLib;
import prefuse.visual.VisualItem;

public class SnmpNetzVizEdgeRenderer extends EdgeRenderer {
	
	//
	public SnmpNetzVizEdgeRenderer() {
		super(Constants.EDGE_TYPE_CURVE);
	}
	
	@Override
	public void render(Graphics2D g, VisualItem item) {
		  // render the edge line
		if (item.getSourceTuple().canGetString("type")) {
			if (item.getSourceTuple().getString("type").equals("switch"))
				m_width = 3;
		}
		else
			m_width = 2;
        super.render(g, item);
        // render the edge arrow head, if appropriate
        if ( m_curArrow != null ) {
            g.setPaint(ColorLib.getColor(item.getFillColor()));
            g.fill(m_curArrow);
        }
	}

}
